#version 460
#extension GL_GOOGLE_include_directive : enable

#include "../../../core/shader_widget_color.h"
#include "../../../core/shader_color.h"

layout(location = 0) in vec2 gCoords;
layout(location = 1) in flat uint gInstanceIndex;

layout(location=0) out vec4 outColor;


layout(std430, column_major, binding = DEF_BINDING_WIDGET_LineProp) readonly buffer U_Matrix_5 {
	S_LineProp LineProp[];
} U_Line;


void main(void){
	//outColor = f_glsl_buildColor(InstanceColor[gInstanceIndex]);
	//outColor *= vColor;
	//outColor = vec4(gCoords,1,1);
	float len = length(gCoords);

	vec4 ColorA = f_glsl_buildColor(U_Line.LineProp[gInstanceIndex].m_ColorA);
	vec4 ColorB = f_glsl_buildColor(U_Line.LineProp[gInstanceIndex].m_ColorB);

	outColor = mix(ColorA.rgba, ColorB.rgba, len);
	//outColor = vec4(color, 1);
	//outColor.a = 0.1;
}





